#!/bin/bash

HOST=$1
PORT=22
USER=$2
PWD=$3
NAME=$4
echo $NAME

sshpass -p $PWD ssh -p $PORT $USER@$HOST /data/app/sh/$NAME.sh stop
sshpass -p $PWD scp -P $PORT /var/lib/jenkins/workspace/jenkins-demo/target/jenkins-demo-0.0.1-SNAPSHOT.jar /data/app/java/$NAME.jar
sshpass -p $PWD ssh -p $PORT $USER@$HOST /data/app/sh/$NAME.sh start